package com.yx.springai.mvpserver;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestClient;

import java.util.HashMap;
import java.util.Map;

@Service
public class OpenMeteService {

    public static Map<String,Dept> map = new HashMap<>();
    public OpenMeteService() {
        map.put("8",new Dept("8","张三SSE"));
        map.put("9",new Dept("9","李雷SSE"));
        map.put("10",new Dept("10","韩梅梅SSE"));
        map.put("6",new Dept("6","李四SSE"));
        map.put("7",new Dept("7","王五SSE"));
    }


    @Tool(description = "根据科室ID查询科室信息")
    public String getUserInfo(String deptId){
        Dept dept = map.get(deptId);
        if (dept == null) {
            return "未找到科室ID为 " + deptId + " 的科室信息。可用的科室ID有：" + map.keySet();
        }
        return dept.toString();
    }
}
